package 综合练习;

import java.util.ArrayList;

public class Exercise4 {
	public static void main(String[] args) {
		ArrayList list = new ArrayList<>();
		list.add("abc");
		list.add("123");
		list.add("java");
		list.add("mysql");
		list.add("别跑啊");
		System.out.print("[");
		for (int i = 0; i < list.size(); i++) {
			if (i == list.size() - 1) {
				System.out.print("0" + list.get(i) + "]");
			} else if (((String) list.get(i)).length() < 4) {
				System.out.print("0" + list.get(i) + ",");
			} else {
				System.out.print(list.get(i) + ",");
			}
		}
	}
}
